<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE DeriveDataTypeable #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE DeriveGeneric #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span> </span><span class="hs-comment">-- can't use Safe due to IsList instance</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Module      :  Data.List.NonEmpty</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Copyright   :  (C) 2011-2015 Edward Kmett,</span><span>
</span><span id="line-10"></span><span class="hs-comment">--                (C) 2010 Tony Morris, Oliver Taylor, Eelis van der Weegen</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- License     :  BSD-style (see the file LICENSE)</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-16"></span><span class="hs-comment">--</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- A 'NonEmpty' list is one which always has at least one element, but</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- is otherwise identical to the traditional list type in complexity</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- and in terms of API. You will almost certainly want to import this</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- module @qualified@.</span><span>
</span><span id="line-21"></span><span class="hs-comment">--</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- @since 4.9.0.0</span><span>
</span><span id="line-23"></span><span class="hs-comment">----------------------------------------------------------------------------</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.List.NonEmpty</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-26"></span><span>   </span><span class="annot"><span class="hs-comment">-- * The type of non-empty streams</span></span><span>
</span><span id="line-27"></span><span>     </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier">NonEmpty</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Non-empty stream transformations</span></span><span>
</span><span id="line-30"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#map"><span class="hs-identifier">map</span></a></span><span>         </span><span class="hs-comment">-- :: (a -&gt; b) -&gt; NonEmpty a -&gt; NonEmpty b</span><span>
</span><span id="line-31"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#intersperse"><span class="hs-identifier">intersperse</span></a></span><span> </span><span class="hs-comment">-- :: a -&gt; NonEmpty a -&gt; NonEmpty a</span><span>
</span><span id="line-32"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#scanl"><span class="hs-identifier">scanl</span></a></span><span>       </span><span class="hs-comment">-- :: Foldable f =&gt; (b -&gt; a -&gt; b) -&gt; b -&gt; f a -&gt; NonEmpty b</span><span>
</span><span id="line-33"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#scanr"><span class="hs-identifier">scanr</span></a></span><span>       </span><span class="hs-comment">-- :: Foldable f =&gt; (a -&gt; b -&gt; b) -&gt; b -&gt; f a -&gt; NonEmpty b</span><span>
</span><span id="line-34"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#scanl1"><span class="hs-identifier">scanl1</span></a></span><span>      </span><span class="hs-comment">-- :: (a -&gt; a -&gt; a) -&gt; NonEmpty a -&gt; NonEmpty a</span><span>
</span><span id="line-35"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#scanr1"><span class="hs-identifier">scanr1</span></a></span><span>      </span><span class="hs-comment">-- :: (a -&gt; a -&gt; a) -&gt; NonEmpty a -&gt; NonEmpty a</span><span>
</span><span id="line-36"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#transpose"><span class="hs-identifier">transpose</span></a></span><span>   </span><span class="hs-comment">-- :: NonEmpty (NonEmpty a) -&gt; NonEmpty (NonEmpty a)</span><span>
</span><span id="line-37"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#sortBy"><span class="hs-identifier">sortBy</span></a></span><span>      </span><span class="hs-comment">-- :: (a -&gt; a -&gt; Ordering) -&gt; NonEmpty a -&gt; NonEmpty a</span><span>
</span><span id="line-38"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#sortWith"><span class="hs-identifier">sortWith</span></a></span><span>      </span><span class="hs-comment">-- :: Ord o =&gt; (a -&gt; o) -&gt; NonEmpty a -&gt; NonEmpty a</span><span>
</span><span id="line-39"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Basic functions</span></span><span>
</span><span id="line-40"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#length"><span class="hs-identifier">length</span></a></span><span>      </span><span class="hs-comment">-- :: NonEmpty a -&gt; Int</span><span>
</span><span id="line-41"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#head"><span class="hs-identifier">head</span></a></span><span>        </span><span class="hs-comment">-- :: NonEmpty a -&gt; a</span><span>
</span><span id="line-42"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#tail"><span class="hs-identifier">tail</span></a></span><span>        </span><span class="hs-comment">-- :: NonEmpty a -&gt; [a]</span><span>
</span><span id="line-43"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#last"><span class="hs-identifier">last</span></a></span><span>        </span><span class="hs-comment">-- :: NonEmpty a -&gt; a</span><span>
</span><span id="line-44"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#init"><span class="hs-identifier">init</span></a></span><span>        </span><span class="hs-comment">-- :: NonEmpty a -&gt; [a]</span><span>
</span><span id="line-45"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#singleton"><span class="hs-identifier">singleton</span></a></span><span>   </span><span class="hs-comment">-- :: a -&gt; NonEmpty a</span><span>
</span><span id="line-46"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#%3C%7C"><span class="hs-operator">(&lt;|)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#cons"><span class="hs-identifier">cons</span></a></span><span>  </span><span class="hs-comment">-- :: a -&gt; NonEmpty a -&gt; NonEmpty a</span><span>
</span><span id="line-47"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#uncons"><span class="hs-identifier">uncons</span></a></span><span>      </span><span class="hs-comment">-- :: NonEmpty a -&gt; (a, Maybe (NonEmpty a))</span><span>
</span><span id="line-48"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#unfoldr"><span class="hs-identifier">unfoldr</span></a></span><span>     </span><span class="hs-comment">-- :: (a -&gt; (b, Maybe a)) -&gt; a -&gt; NonEmpty b</span><span>
</span><span id="line-49"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#sort"><span class="hs-identifier">sort</span></a></span><span>        </span><span class="hs-comment">-- :: NonEmpty a -&gt; NonEmpty a</span><span>
</span><span id="line-50"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#reverse"><span class="hs-identifier">reverse</span></a></span><span>     </span><span class="hs-comment">-- :: NonEmpty a -&gt; NonEmpty a</span><span>
</span><span id="line-51"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#inits"><span class="hs-identifier">inits</span></a></span><span>       </span><span class="hs-comment">-- :: Foldable f =&gt; f a -&gt; NonEmpty a</span><span>
</span><span id="line-52"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#tails"><span class="hs-identifier">tails</span></a></span><span>       </span><span class="hs-comment">-- :: Foldable f =&gt; f a -&gt; NonEmpty a</span><span>
</span><span id="line-53"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Building streams</span></span><span>
</span><span id="line-54"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#iterate"><span class="hs-identifier">iterate</span></a></span><span>     </span><span class="hs-comment">-- :: (a -&gt; a) -&gt; a -&gt; NonEmpty a</span><span>
</span><span id="line-55"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#repeat"><span class="hs-identifier">repeat</span></a></span><span>      </span><span class="hs-comment">-- :: a -&gt; NonEmpty a</span><span>
</span><span id="line-56"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#cycle"><span class="hs-identifier">cycle</span></a></span><span>       </span><span class="hs-comment">-- :: NonEmpty a -&gt; NonEmpty a</span><span>
</span><span id="line-57"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#unfold"><span class="hs-identifier">unfold</span></a></span><span>      </span><span class="hs-comment">-- :: (a -&gt; (b, Maybe a) -&gt; a -&gt; NonEmpty b</span><span>
</span><span id="line-58"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#insert"><span class="hs-identifier">insert</span></a></span><span>      </span><span class="hs-comment">-- :: (Foldable f, Ord a) =&gt; a -&gt; f a -&gt; NonEmpty a</span><span>
</span><span id="line-59"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#some1"><span class="hs-identifier">some1</span></a></span><span>       </span><span class="hs-comment">-- :: Alternative f =&gt; f a -&gt; f (NonEmpty a)</span><span>
</span><span id="line-60"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Extracting sublists</span></span><span>
</span><span id="line-61"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#take"><span class="hs-identifier">take</span></a></span><span>        </span><span class="hs-comment">-- :: Int -&gt; NonEmpty a -&gt; [a]</span><span>
</span><span id="line-62"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#drop"><span class="hs-identifier">drop</span></a></span><span>        </span><span class="hs-comment">-- :: Int -&gt; NonEmpty a -&gt; [a]</span><span>
</span><span id="line-63"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#splitAt"><span class="hs-identifier">splitAt</span></a></span><span>     </span><span class="hs-comment">-- :: Int -&gt; NonEmpty a -&gt; ([a], [a])</span><span>
</span><span id="line-64"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#takeWhile"><span class="hs-identifier">takeWhile</span></a></span><span>   </span><span class="hs-comment">-- :: Int -&gt; NonEmpty a -&gt; [a]</span><span>
</span><span id="line-65"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#dropWhile"><span class="hs-identifier">dropWhile</span></a></span><span>   </span><span class="hs-comment">-- :: Int -&gt; NonEmpty a -&gt; [a]</span><span>
</span><span id="line-66"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#span"><span class="hs-identifier">span</span></a></span><span>        </span><span class="hs-comment">-- :: Int -&gt; NonEmpty a -&gt; ([a],[a])</span><span>
</span><span id="line-67"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#break"><span class="hs-identifier">break</span></a></span><span>       </span><span class="hs-comment">-- :: Int -&gt; NonEmpty a -&gt; ([a],[a])</span><span>
</span><span id="line-68"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#filter"><span class="hs-identifier">filter</span></a></span><span>      </span><span class="hs-comment">-- :: (a -&gt; Bool) -&gt; NonEmpty a -&gt; [a]</span><span>
</span><span id="line-69"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#partition"><span class="hs-identifier">partition</span></a></span><span>   </span><span class="hs-comment">-- :: (a -&gt; Bool) -&gt; NonEmpty a -&gt; ([a],[a])</span><span>
</span><span id="line-70"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#group"><span class="hs-identifier">group</span></a></span><span>       </span><span class="hs-comment">-- :: Foldable f =&gt; Eq a =&gt; f a -&gt; [NonEmpty a]</span><span>
</span><span id="line-71"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#groupBy"><span class="hs-identifier">groupBy</span></a></span><span>     </span><span class="hs-comment">-- :: Foldable f =&gt; (a -&gt; a -&gt; Bool) -&gt; f a -&gt; [NonEmpty a]</span><span>
</span><span id="line-72"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#groupWith"><span class="hs-identifier">groupWith</span></a></span><span>     </span><span class="hs-comment">-- :: (Foldable f, Eq b) =&gt; (a -&gt; b) -&gt; f a -&gt; [NonEmpty a]</span><span>
</span><span id="line-73"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#groupAllWith"><span class="hs-identifier">groupAllWith</span></a></span><span>  </span><span class="hs-comment">-- :: (Foldable f, Ord b) =&gt; (a -&gt; b) -&gt; f a -&gt; [NonEmpty a]</span><span>
</span><span id="line-74"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#group1"><span class="hs-identifier">group1</span></a></span><span>      </span><span class="hs-comment">-- :: Eq a =&gt; NonEmpty a -&gt; NonEmpty (NonEmpty a)</span><span>
</span><span id="line-75"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#groupBy1"><span class="hs-identifier">groupBy1</span></a></span><span>    </span><span class="hs-comment">-- :: (a -&gt; a -&gt; Bool) -&gt; NonEmpty a -&gt; NonEmpty (NonEmpty a)</span><span>
</span><span id="line-76"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#groupWith1"><span class="hs-identifier">groupWith1</span></a></span><span>     </span><span class="hs-comment">-- :: (Foldable f, Eq b) =&gt; (a -&gt; b) -&gt; f a -&gt; NonEmpty (NonEmpty a)</span><span>
</span><span id="line-77"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#groupAllWith1"><span class="hs-identifier">groupAllWith1</span></a></span><span>  </span><span class="hs-comment">-- :: (Foldable f, Ord b) =&gt; (a -&gt; b) -&gt; f a -&gt; NonEmpty (NonEmpty a)</span><span>
</span><span id="line-78"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Sublist predicates</span></span><span>
</span><span id="line-79"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#isPrefixOf"><span class="hs-identifier">isPrefixOf</span></a></span><span>  </span><span class="hs-comment">-- :: Foldable f =&gt; f a -&gt; NonEmpty a -&gt; Bool</span><span>
</span><span id="line-80"></span><span>   </span><span class="annot"><span class="hs-comment">-- * \&quot;Set\&quot; operations</span></span><span>
</span><span id="line-81"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#nub"><span class="hs-identifier">nub</span></a></span><span>         </span><span class="hs-comment">-- :: Eq a =&gt; NonEmpty a -&gt; NonEmpty a</span><span>
</span><span id="line-82"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#nubBy"><span class="hs-identifier">nubBy</span></a></span><span>       </span><span class="hs-comment">-- :: (a -&gt; a -&gt; Bool) -&gt; NonEmpty a -&gt; NonEmpty a</span><span>
</span><span id="line-83"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Indexing streams</span></span><span>
</span><span id="line-84"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#%21%21"><span class="hs-operator">(!!)</span></a></span><span>        </span><span class="hs-comment">-- :: NonEmpty a -&gt; Int -&gt; a</span><span>
</span><span id="line-85"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Zipping and unzipping streams</span></span><span>
</span><span id="line-86"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#zip"><span class="hs-identifier">zip</span></a></span><span>         </span><span class="hs-comment">-- :: NonEmpty a -&gt; NonEmpty b -&gt; NonEmpty (a,b)</span><span>
</span><span id="line-87"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#zipWith"><span class="hs-identifier">zipWith</span></a></span><span>     </span><span class="hs-comment">-- :: (a -&gt; b -&gt; c) -&gt; NonEmpty a -&gt; NonEmpty b -&gt; NonEmpty c</span><span>
</span><span id="line-88"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#unzip"><span class="hs-identifier">unzip</span></a></span><span>       </span><span class="hs-comment">-- :: NonEmpty (a, b) -&gt; (NonEmpty a, NonEmpty b)</span><span>
</span><span id="line-89"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Converting to and from a list</span></span><span>
</span><span id="line-90"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier">fromList</span></a></span><span>    </span><span class="hs-comment">-- :: [a] -&gt; NonEmpty a</span><span>
</span><span id="line-91"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier">toList</span></a></span><span>      </span><span class="hs-comment">-- :: NonEmpty a -&gt; [a]</span><span>
</span><span id="line-92"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#nonEmpty"><span class="hs-identifier">nonEmpty</span></a></span><span>    </span><span class="hs-comment">-- :: [a] -&gt; Maybe (NonEmpty a)</span><span>
</span><span id="line-93"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#xor"><span class="hs-identifier">xor</span></a></span><span>         </span><span class="hs-comment">-- :: NonEmpty a -&gt; Bool</span><span>
</span><span id="line-94"></span><span>   </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="Prelude.html"><span class="hs-identifier">Prelude</span></a></span><span>             </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.List.html#break"><span class="hs-identifier">break</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#cycle"><span class="hs-identifier">cycle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#drop"><span class="hs-identifier">drop</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#dropWhile"><span class="hs-identifier">dropWhile</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-98"></span><span>                                      </span><span class="annot"><a href="GHC.List.html#filter"><span class="hs-identifier">filter</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#foldl"><span class="hs-identifier">foldl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#foldr"><span class="hs-identifier">foldr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#head"><span class="hs-identifier">head</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#init"><span class="hs-identifier">init</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#iterate"><span class="hs-identifier">iterate</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-99"></span><span>                                      </span><span class="annot"><a href="GHC.List.html#last"><span class="hs-identifier">last</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#length"><span class="hs-identifier">length</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#map"><span class="hs-identifier">map</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#repeat"><span class="hs-identifier">repeat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#reverse"><span class="hs-identifier">reverse</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-100"></span><span>                                      </span><span class="annot"><a href="GHC.List.html#scanl"><span class="hs-identifier">scanl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#scanl1"><span class="hs-identifier">scanl1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#scanr"><span class="hs-identifier">scanr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#scanr1"><span class="hs-identifier">scanr1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#span"><span class="hs-identifier">span</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-101"></span><span>                                      </span><span class="annot"><a href="GHC.List.html#splitAt"><span class="hs-identifier">splitAt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#tail"><span class="hs-identifier">tail</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#take"><span class="hs-identifier">take</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#takeWhile"><span class="hs-identifier">takeWhile</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-102"></span><span>                                      </span><span class="annot"><a href="GHC.List.html#unzip"><span class="hs-identifier">unzip</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#zip"><span class="hs-identifier">zip</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#zipWith"><span class="hs-identifier">zipWith</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#%21%21"><span class="hs-operator">(!!)</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-103"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Prelude.html"><span class="hs-identifier">Prelude</span></a></span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="Control.Applicative.html"><span class="hs-identifier">Control.Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier">Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier">Alternative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#many"><span class="hs-identifier">many</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-106"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="Data.Foldable.html"><span class="hs-identifier">Data.Foldable</span></a></span><span>       </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Foldable.html#length"><span class="hs-identifier">length</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#toList"><span class="hs-identifier">toList</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-107"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Foldable.html"><span class="hs-identifier">Data.Foldable</span></a></span><span>       </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Foldable</span></span><span>
</span><span id="line-108"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="Data.Function.html"><span class="hs-identifier">Data.Function</span></a></span><span>       </span><span class="hs-special">(</span><span class="annot"><a href="Data.Function.html#on"><span class="hs-identifier">on</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-109"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.List.html"><span class="hs-identifier">Data.List</span></a></span><span>           </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">List</span></span><span>
</span><span id="line-110"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="Data.Ord.html"><span class="hs-identifier">Data.Ord</span></a></span><span>            </span><span class="hs-special">(</span><span class="annot"><a href="Data.Ord.html#comparing"><span class="hs-identifier">comparing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-111"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>            </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier">NonEmpty</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">5</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#%3C%7C"><span class="hs-operator hs-type">&lt;|</span></a></span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span class="hs-comment">-- | Number of elements in 'NonEmpty' list.</span><span>
</span><span id="line-116"></span><span id="local-6989586621679567471"><span class="annot"><a href="Data.List.NonEmpty.html#length"><span class="hs-identifier hs-type">length</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567471"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span></span><span>
</span><span id="line-117"></span><span id="length"><span class="annot"><span class="annottext">length :: forall a. NonEmpty a -&gt; Int
</span><a href="Data.List.NonEmpty.html#length"><span class="hs-identifier hs-var hs-var">length</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679567162"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567162"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="Data.Foldable.html#length"><span class="hs-identifier hs-var">Prelude.length</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567162"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span class="hs-comment">-- | Compute n-ary logic exclusive OR operation on 'NonEmpty' list.</span><span>
</span><span id="line-120"></span><span class="annot"><a href="Data.List.NonEmpty.html#xor"><span class="hs-identifier hs-type">xor</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-121"></span><span id="xor"><span class="annot"><span class="annottext">xor :: NonEmpty Bool -&gt; Bool
</span><a href="Data.List.NonEmpty.html#xor"><span class="hs-identifier hs-var hs-var">xor</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679567160"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679567160"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679567159"><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621679567159"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool -&gt; Bool) -&gt; Bool -&gt; [Bool] -&gt; Bool
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="#local-6989586621679567158"><span class="hs-identifier hs-var">xor'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679567160"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621679567159"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-122"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679567158"><span class="annot"><span class="annottext">xor' :: Bool -&gt; Bool -&gt; Bool
</span><a href="#local-6989586621679567158"><span class="hs-identifier hs-var hs-var">xor'</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span id="local-6989586621679567157"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679567157"><span class="hs-identifier hs-var">y</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#not"><span class="hs-identifier hs-var">not</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679567157"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-123"></span><span>        </span><span class="annot"><a href="#local-6989586621679567158"><span class="hs-identifier hs-var">xor'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span id="local-6989586621679567155"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679567155"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679567155"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="hs-comment">-- | 'unfold' produces a new stream by repeatedly applying the unfolding</span><span>
</span><span id="line-126"></span><span class="hs-comment">-- function to the seed value to produce an element of type @b@ and a new</span><span>
</span><span id="line-127"></span><span class="hs-comment">-- seed value.  When the unfolding function returns 'Nothing' instead of</span><span>
</span><span id="line-128"></span><span class="hs-comment">-- a new seed value, the stream ends.</span><span>
</span><span id="line-129"></span><span id="local-6989586621679567462"><span id="local-6989586621679567463"><span class="annot"><a href="Data.List.NonEmpty.html#unfold"><span class="hs-identifier hs-type">unfold</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567463"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567462"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567463"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567463"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567462"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-130"></span><span id="unfold"><span class="annot"><span class="annottext">unfold :: forall a b. (a -&gt; (b, Maybe a)) -&gt; a -&gt; NonEmpty b
</span><a href="Data.List.NonEmpty.html#unfold"><span class="hs-identifier hs-var hs-var">unfold</span></a></span></span><span> </span><span id="local-6989586621679567154"><span class="annot"><span class="annottext">a -&gt; (b, Maybe a)
</span><a href="#local-6989586621679567154"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679567153"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567153"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; (b, Maybe a)
</span><a href="#local-6989586621679567154"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567153"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-131"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621679567152"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679567152"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679567152"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; [b] -&gt; NonEmpty b
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-132"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621679567151"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679567151"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679567150"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567150"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679567151"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; NonEmpty b -&gt; NonEmpty b
forall a. a -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#%3C%7C"><span class="hs-operator hs-var">&lt;|</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; (b, Maybe a)) -&gt; a -&gt; NonEmpty b
forall a b. (a -&gt; (b, Maybe a)) -&gt; a -&gt; NonEmpty b
</span><a href="Data.List.NonEmpty.html#unfold"><span class="hs-identifier hs-var">unfold</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; (b, Maybe a)
</span><a href="#local-6989586621679567154"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567150"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-133"></span><span class="hs-pragma">{-# DEPRECATED</span><span> </span><span class="hs-pragma">unfold</span><span> </span><span class="hs-pragma">&quot;Use unfoldr&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-134"></span><span class="hs-comment">-- Deprecated in 8.2.1, remove in 8.4</span><span>
</span><span id="line-135"></span><span>
</span><span id="line-136"></span><span class="hs-comment">-- | 'nonEmpty' efficiently turns a normal list into a 'NonEmpty' stream,</span><span>
</span><span id="line-137"></span><span class="hs-comment">-- producing 'Nothing' if the input is empty.</span><span>
</span><span id="line-138"></span><span id="local-6989586621679567456"><span class="annot"><a href="Data.List.NonEmpty.html#nonEmpty"><span class="hs-identifier hs-type">nonEmpty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567456"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567456"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-139"></span><span id="nonEmpty"><span class="annot"><span class="annottext">nonEmpty :: forall a. [a] -&gt; Maybe (NonEmpty a)
</span><a href="Data.List.NonEmpty.html#nonEmpty"><span class="hs-identifier hs-var hs-var">nonEmpty</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (NonEmpty a)
forall a. Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-140"></span><span class="annot"><a href="Data.List.NonEmpty.html#nonEmpty"><span class="hs-identifier hs-var">nonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679567149"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567149"><span class="hs-identifier hs-var">a</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679567148"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567148"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; Maybe (NonEmpty a)
forall a. a -&gt; Maybe a
</span><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567149"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567148"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span class="hs-comment">-- | 'uncons' produces the first element of the stream, and a stream of the</span><span>
</span><span id="line-143"></span><span class="hs-comment">-- remaining elements, if any.</span><span>
</span><span id="line-144"></span><span id="local-6989586621679567454"><span class="annot"><a href="Data.List.NonEmpty.html#uncons"><span class="hs-identifier hs-type">uncons</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567454"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567454"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567454"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-145"></span><span id="uncons"><span class="annot"><span class="annottext">uncons :: forall a. NonEmpty a -&gt; (a, Maybe (NonEmpty a))
</span><a href="Data.List.NonEmpty.html#uncons"><span class="hs-identifier hs-var hs-var">uncons</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679567147"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567147"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679567146"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567146"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567147"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; Maybe (NonEmpty a)
forall a. [a] -&gt; Maybe (NonEmpty a)
</span><a href="Data.List.NonEmpty.html#nonEmpty"><span class="hs-identifier hs-var">nonEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567146"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span class="hs-comment">-- | The 'unfoldr' function is analogous to &quot;Data.List&quot;'s</span><span>
</span><span id="line-148"></span><span class="hs-comment">-- 'Data.List.unfoldr' operation.</span><span>
</span><span id="line-149"></span><span id="local-6989586621679567144"><span id="local-6989586621679567145"><span class="annot"><a href="Data.List.NonEmpty.html#unfoldr"><span class="hs-identifier hs-type">unfoldr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567145"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567144"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567145"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567145"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567144"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-150"></span><span id="unfoldr"><span class="annot"><span class="annottext">unfoldr :: forall a b. (a -&gt; (b, Maybe a)) -&gt; a -&gt; NonEmpty b
</span><a href="Data.List.NonEmpty.html#unfoldr"><span class="hs-identifier hs-var hs-var">unfoldr</span></a></span></span><span> </span><span id="local-6989586621679567143"><span class="annot"><span class="annottext">a -&gt; (b, Maybe a)
</span><a href="#local-6989586621679567143"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679567142"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567142"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; (b, Maybe a)
</span><a href="#local-6989586621679567143"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567142"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-151"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621679567141"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679567141"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679567140"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679567140"><span class="hs-identifier hs-var">mc</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679567141"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; [b] -&gt; NonEmpty b
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[b] -&gt; (a -&gt; [b]) -&gt; Maybe a -&gt; [b]
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">a -&gt; [b]
</span><a href="#local-6989586621679567138"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679567140"><span class="hs-identifier hs-var">mc</span></a></span><span>
</span><span id="line-152"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-153"></span><span>    </span><span id="local-6989586621679567138"><span class="annot"><span class="annottext">go :: a -&gt; [b]
</span><a href="#local-6989586621679567138"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679567137"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567137"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; (b, Maybe a)
</span><a href="#local-6989586621679567143"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567137"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-154"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621679567136"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679567136"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679567135"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679567135"><span class="hs-identifier hs-var">me</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679567136"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; [b] -&gt; [b]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[b] -&gt; (a -&gt; [b]) -&gt; Maybe a -&gt; [b]
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">a -&gt; [b]
</span><a href="#local-6989586621679567138"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679567135"><span class="hs-identifier hs-var">me</span></a></span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span class="hs-comment">-- | Extract the first element of the stream.</span><span>
</span><span id="line-157"></span><span id="local-6989586621679567448"><span class="annot"><a href="Data.List.NonEmpty.html#head"><span class="hs-identifier hs-type">head</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567448"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567448"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-158"></span><span id="head"><span class="annot"><span class="annottext">head :: forall a. NonEmpty a -&gt; a
</span><a href="Data.List.NonEmpty.html#head"><span class="hs-identifier hs-var hs-var">head</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679567134"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567134"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567134"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span class="hs-comment">-- | Extract the possibly-empty tail of the stream.</span><span>
</span><span id="line-161"></span><span id="local-6989586621679567446"><span class="annot"><a href="Data.List.NonEmpty.html#tail"><span class="hs-identifier hs-type">tail</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567446"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567446"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-162"></span><span id="tail"><span class="annot"><span class="annottext">tail :: forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#tail"><span class="hs-identifier hs-var hs-var">tail</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679567133"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567133"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567133"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span class="hs-comment">-- | Extract the last element of the stream.</span><span>
</span><span id="line-165"></span><span id="local-6989586621679567132"><span class="annot"><a href="Data.List.NonEmpty.html#last"><span class="hs-identifier hs-type">last</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567132"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567132"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-166"></span><span id="last"><span class="annot"><span class="annottext">last :: forall a. NonEmpty a -&gt; a
</span><a href="Data.List.NonEmpty.html#last"><span class="hs-identifier hs-var hs-var">last</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679567131"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567131"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679567130"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567130"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; a
forall a. [a] -&gt; a
</span><a href="GHC.List.html#last"><span class="hs-identifier hs-var">List.last</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567131"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567130"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-167"></span><span>
</span><span id="line-168"></span><span class="hs-comment">-- | Extract everything except the last element of the stream.</span><span>
</span><span id="line-169"></span><span id="local-6989586621679567129"><span class="annot"><a href="Data.List.NonEmpty.html#init"><span class="hs-identifier hs-type">init</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567129"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567129"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-170"></span><span id="init"><span class="annot"><span class="annottext">init :: forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#init"><span class="hs-identifier hs-var hs-var">init</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679567128"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567128"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679567127"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567127"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. [a] -&gt; [a]
</span><a href="GHC.List.html#init"><span class="hs-identifier hs-var">List.init</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567128"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567127"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span class="hs-comment">-- | Construct a 'NonEmpty' list from a single element.</span><span>
</span><span id="line-173"></span><span class="hs-comment">--</span><span>
</span><span id="line-174"></span><span class="hs-comment">-- @since 4.15</span><span>
</span><span id="line-175"></span><span id="local-6989586621679567440"><span class="annot"><a href="Data.List.NonEmpty.html#singleton"><span class="hs-identifier hs-type">singleton</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679567440"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567440"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-176"></span><span id="singleton"><span class="annot"><span class="annottext">singleton :: forall a. a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#singleton"><span class="hs-identifier hs-var hs-var">singleton</span></a></span></span><span> </span><span id="local-6989586621679567126"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567126"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567126"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-177"></span><span>
</span><span id="line-178"></span><span class="hs-comment">-- | Prepend an element to the stream.</span><span>
</span><span id="line-179"></span><span id="local-6989586621679567457"><span class="annot"><a href="Data.List.NonEmpty.html#%3C%7C"><span class="hs-operator hs-type">(&lt;|)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679567457"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567457"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567457"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-180"></span><span id="local-6989586621679567125"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567125"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="%3C%7C"><span class="annot"><span class="annottext">&lt;| :: forall a. a -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#%3C%7C"><span class="hs-operator hs-var hs-var">&lt;|</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679567124"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567124"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679567123"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567123"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567125"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567124"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567123"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span class="hs-comment">-- | Synonym for '&lt;|'.</span><span>
</span><span id="line-183"></span><span id="local-6989586621679567122"><span class="annot"><a href="Data.List.NonEmpty.html#cons"><span class="hs-identifier hs-type">cons</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679567122"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567122"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567122"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-184"></span><span id="cons"><span class="annot"><span class="annottext">cons :: forall a. a -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#cons"><span class="hs-identifier hs-var hs-var">cons</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; NonEmpty a -&gt; NonEmpty a
forall a. a -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#%3C%7C"><span class="hs-operator hs-var">(&lt;|)</span></a></span><span>
</span><span id="line-185"></span><span>
</span><span id="line-186"></span><span class="hs-comment">-- | Sort a stream.</span><span>
</span><span id="line-187"></span><span id="local-6989586621679567436"><span class="annot"><a href="Data.List.NonEmpty.html#sort"><span class="hs-identifier hs-type">sort</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-type">Ord</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567436"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567436"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567436"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-188"></span><span id="sort"><span class="annot"><span class="annottext">sort :: forall a. Ord a =&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#sort"><span class="hs-identifier hs-var hs-var">sort</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [a]) -&gt; NonEmpty a -&gt; NonEmpty a
forall (f :: * -&gt; *) a b.
Foldable f =&gt;
([a] -&gt; [b]) -&gt; f a -&gt; NonEmpty b
</span><a href="Data.List.NonEmpty.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. Ord a =&gt; [a] -&gt; [a]
</span><a href="Data.OldList.html#sort"><span class="hs-identifier hs-var">List.sort</span></a></span><span>
</span><span id="line-189"></span><span>
</span><span id="line-190"></span><span class="hs-comment">-- | Converts a normal list to a 'NonEmpty' stream.</span><span>
</span><span id="line-191"></span><span class="hs-comment">--</span><span>
</span><span id="line-192"></span><span class="hs-comment">-- Raises an error if given an empty list.</span><span>
</span><span id="line-193"></span><span id="local-6989586621679567430"><span class="annot"><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-type">fromList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567430"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567430"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-194"></span><span id="fromList"><span class="annot"><span class="annottext">fromList :: forall a. [a] -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var hs-var">fromList</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679567115"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567115"><span class="hs-identifier hs-var">a</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679567114"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567114"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567115"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567114"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-195"></span><span class="annot"><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var">fromList</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; NonEmpty a
forall a. [Char] -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;NonEmpty.fromList: empty list&quot;</span></span><span>
</span><span id="line-196"></span><span>
</span><span id="line-197"></span><span class="hs-comment">-- | Convert a stream to a normal list efficiently.</span><span>
</span><span id="line-198"></span><span id="local-6989586621679567112"><span class="annot"><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-type">toList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567112"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567112"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-199"></span><span id="toList"><span class="annot"><span class="annottext">toList :: forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var hs-var">toList</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679567111"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567111"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679567110"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567110"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567111"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567110"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-200"></span><span>
</span><span id="line-201"></span><span class="hs-comment">-- | Lift list operations to work on a 'NonEmpty' stream.</span><span>
</span><span id="line-202"></span><span class="hs-comment">--</span><span>
</span><span id="line-203"></span><span class="hs-comment">-- /Beware/: If the provided function returns an empty list,</span><span>
</span><span id="line-204"></span><span class="hs-comment">-- this will raise an error.</span><span>
</span><span id="line-205"></span><span id="local-6989586621679567432"><span id="local-6989586621679567433"><span id="local-6989586621679567434"><span class="annot"><a href="Data.List.NonEmpty.html#lift"><span class="hs-identifier hs-type">lift</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567434"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567433"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567432"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567434"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567433"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567432"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-206"></span><span id="lift"><span class="annot"><span class="annottext">lift :: forall (f :: * -&gt; *) a b.
Foldable f =&gt;
([a] -&gt; [b]) -&gt; f a -&gt; NonEmpty b
</span><a href="Data.List.NonEmpty.html#lift"><span class="hs-identifier hs-var hs-var">lift</span></a></span></span><span> </span><span id="local-6989586621679567107"><span class="annot"><span class="annottext">[a] -&gt; [b]
</span><a href="#local-6989586621679567107"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[b] -&gt; NonEmpty b
forall a. [a] -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var">fromList</span></a></span><span> </span><span class="annot"><span class="annottext">([b] -&gt; NonEmpty b) -&gt; (f a -&gt; [b]) -&gt; f a -&gt; NonEmpty b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [b]
</span><a href="#local-6989586621679567107"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [b]) -&gt; (f a -&gt; [a]) -&gt; f a -&gt; [b]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">f a -&gt; [a]
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; [a]
</span><a href="Data.Foldable.html#toList"><span class="hs-identifier hs-var">Foldable.toList</span></a></span><span>
</span><span id="line-207"></span><span>
</span><span id="line-208"></span><span class="hs-comment">-- | Map a function over a 'NonEmpty' stream.</span><span>
</span><span id="line-209"></span><span id="local-6989586621679567417"><span id="local-6989586621679567418"><span class="annot"><a href="Data.List.NonEmpty.html#map"><span class="hs-identifier hs-type">map</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567418"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567417"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567418"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567417"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-210"></span><span id="map"><span class="annot"><span class="annottext">map :: forall a b. (a -&gt; b) -&gt; NonEmpty a -&gt; NonEmpty b
</span><a href="Data.List.NonEmpty.html#map"><span class="hs-identifier hs-var hs-var">map</span></a></span></span><span> </span><span id="local-6989586621679567103"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679567103"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679567102"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567102"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679567101"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567101"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679567103"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567102"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; [b] -&gt; NonEmpty b
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; [a] -&gt; [b]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679567103"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567101"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-211"></span><span>
</span><span id="line-212"></span><span class="hs-comment">-- | The 'inits' function takes a stream @xs@ and returns all the</span><span>
</span><span id="line-213"></span><span class="hs-comment">-- finite prefixes of @xs@.</span><span>
</span><span id="line-214"></span><span id="local-6989586621679567410"><span id="local-6989586621679567411"><span class="annot"><a href="Data.List.NonEmpty.html#inits"><span class="hs-identifier hs-type">inits</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567411"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567411"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567410"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567410"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-215"></span><span id="inits"><span class="annot"><span class="annottext">inits :: forall (f :: * -&gt; *) a. Foldable f =&gt; f a -&gt; NonEmpty [a]
</span><a href="Data.List.NonEmpty.html#inits"><span class="hs-identifier hs-var hs-var">inits</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[[a]] -&gt; NonEmpty [a]
forall a. [a] -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var">fromList</span></a></span><span> </span><span class="annot"><span class="annottext">([[a]] -&gt; NonEmpty [a]) -&gt; (f a -&gt; [[a]]) -&gt; f a -&gt; NonEmpty [a]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [[a]]
forall a. [a] -&gt; [[a]]
</span><a href="Data.OldList.html#inits"><span class="hs-identifier hs-var">List.inits</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [[a]]) -&gt; (f a -&gt; [a]) -&gt; f a -&gt; [[a]]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">f a -&gt; [a]
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; [a]
</span><a href="Data.Foldable.html#toList"><span class="hs-identifier hs-var">Foldable.toList</span></a></span><span>
</span><span id="line-216"></span><span>
</span><span id="line-217"></span><span class="hs-comment">-- | The 'tails' function takes a stream @xs@ and returns all the</span><span>
</span><span id="line-218"></span><span class="hs-comment">-- suffixes of @xs@.</span><span>
</span><span id="line-219"></span><span id="local-6989586621679567096"><span id="local-6989586621679567097"><span class="annot"><a href="Data.List.NonEmpty.html#tails"><span class="hs-identifier hs-type">tails</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567097"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567097"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567096"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567096"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-220"></span><span id="tails"><span class="annot"><span class="annottext">tails :: forall (f :: * -&gt; *) a. Foldable f =&gt; f a -&gt; NonEmpty [a]
</span><a href="Data.List.NonEmpty.html#tails"><span class="hs-identifier hs-var hs-var">tails</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[[a]] -&gt; NonEmpty [a]
forall a. [a] -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var">fromList</span></a></span><span> </span><span class="annot"><span class="annottext">([[a]] -&gt; NonEmpty [a]) -&gt; (f a -&gt; [[a]]) -&gt; f a -&gt; NonEmpty [a]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [[a]]
forall a. [a] -&gt; [[a]]
</span><a href="Data.OldList.html#tails"><span class="hs-identifier hs-var">List.tails</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [[a]]) -&gt; (f a -&gt; [a]) -&gt; f a -&gt; [[a]]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">f a -&gt; [a]
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; [a]
</span><a href="Data.Foldable.html#toList"><span class="hs-identifier hs-var">Foldable.toList</span></a></span><span>
</span><span id="line-221"></span><span>
</span><span id="line-222"></span><span class="hs-comment">-- | @'insert' x xs@ inserts @x@ into the last position in @xs@ where it</span><span>
</span><span id="line-223"></span><span class="hs-comment">-- is still less than or equal to the next element. In particular, if the</span><span>
</span><span id="line-224"></span><span class="hs-comment">-- list is sorted beforehand, the result will also be sorted.</span><span>
</span><span id="line-225"></span><span id="local-6989586621679567403"><span id="local-6989586621679567404"><span class="annot"><a href="Data.List.NonEmpty.html#insert"><span class="hs-identifier hs-type">insert</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567404"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-type">Ord</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567403"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567403"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567404"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567403"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567403"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-226"></span><span id="insert"><span class="annot"><span class="annottext">insert :: forall (f :: * -&gt; *) a.
(Foldable f, Ord a) =&gt;
a -&gt; f a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#insert"><span class="hs-identifier hs-var hs-var">insert</span></a></span></span><span> </span><span id="local-6989586621679567088"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567088"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; NonEmpty a
forall a. [a] -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var">fromList</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; NonEmpty a) -&gt; (f a -&gt; [a]) -&gt; f a -&gt; NonEmpty a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. Ord a =&gt; a -&gt; [a] -&gt; [a]
</span><a href="Data.OldList.html#insert"><span class="hs-identifier hs-var">List.insert</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567088"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [a]) -&gt; (f a -&gt; [a]) -&gt; f a -&gt; [a]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">f a -&gt; [a]
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; [a]
</span><a href="Data.Foldable.html#toList"><span class="hs-identifier hs-var">Foldable.toList</span></a></span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span class="hs-comment">-- | @'some1' x@ sequences @x@ one or more times.</span><span>
</span><span id="line-229"></span><span id="local-6989586621679567397"><span id="local-6989586621679567399"><span class="annot"><a href="Data.List.NonEmpty.html#some1"><span class="hs-identifier hs-type">some1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567399"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567399"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567397"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567399"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567397"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-230"></span><span id="some1"><span class="annot"><span class="annottext">some1 :: forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f (NonEmpty a)
</span><a href="Data.List.NonEmpty.html#some1"><span class="hs-identifier hs-var hs-var">some1</span></a></span></span><span> </span><span id="local-6989586621679567081"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679567081"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; [a] -&gt; NonEmpty a) -&gt; f a -&gt; f [a] -&gt; f (NonEmpty a)
forall (f :: * -&gt; *) a b c.
Applicative f =&gt;
(a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c
</span><a href="GHC.Base.html#liftA2"><span class="hs-identifier hs-var">liftA2</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">(:|)</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679567081"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f a -&gt; f [a]
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f [a]
</span><a href="GHC.Base.html#many"><span class="hs-identifier hs-var">many</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679567081"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span>
</span><span id="line-232"></span><span class="hs-comment">-- | 'scanl' is similar to 'foldl', but returns a stream of successive</span><span>
</span><span id="line-233"></span><span class="hs-comment">-- reduced values from the left:</span><span>
</span><span id="line-234"></span><span class="hs-comment">--</span><span>
</span><span id="line-235"></span><span class="hs-comment">-- &gt; scanl f z [x1, x2, ...] == z :| [z `f` x1, (z `f` x1) `f` x2, ...]</span><span>
</span><span id="line-236"></span><span class="hs-comment">--</span><span>
</span><span id="line-237"></span><span class="hs-comment">-- Note that</span><span>
</span><span id="line-238"></span><span class="hs-comment">--</span><span>
</span><span id="line-239"></span><span class="hs-comment">-- &gt; last (scanl f z xs) == foldl f z xs.</span><span>
</span><span id="line-240"></span><span id="local-6989586621679567386"><span id="local-6989586621679567387"><span id="local-6989586621679567388"><span class="annot"><a href="Data.List.NonEmpty.html#scanl"><span class="hs-identifier hs-type">scanl</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567388"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567387"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567386"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567387"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567387"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567388"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567386"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567387"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-241"></span><span id="scanl"><span class="annot"><span class="annottext">scanl :: forall (f :: * -&gt; *) b a.
Foldable f =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; f a -&gt; NonEmpty b
</span><a href="Data.List.NonEmpty.html#scanl"><span class="hs-identifier hs-var hs-var">scanl</span></a></span></span><span> </span><span id="local-6989586621679567077"><span class="annot"><span class="annottext">b -&gt; a -&gt; b
</span><a href="#local-6989586621679567077"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679567076"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679567076"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[b] -&gt; NonEmpty b
forall a. [a] -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var">fromList</span></a></span><span> </span><span class="annot"><span class="annottext">([b] -&gt; NonEmpty b) -&gt; (f a -&gt; [b]) -&gt; f a -&gt; NonEmpty b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; a -&gt; b) -&gt; b -&gt; [a] -&gt; [b]
forall b a. (b -&gt; a -&gt; b) -&gt; b -&gt; [a] -&gt; [b]
</span><a href="GHC.List.html#scanl"><span class="hs-identifier hs-var">List.scanl</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a -&gt; b
</span><a href="#local-6989586621679567077"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679567076"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [b]) -&gt; (f a -&gt; [a]) -&gt; f a -&gt; [b]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">f a -&gt; [a]
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; [a]
</span><a href="Data.Foldable.html#toList"><span class="hs-identifier hs-var">Foldable.toList</span></a></span><span>
</span><span id="line-242"></span><span>
</span><span id="line-243"></span><span class="hs-comment">-- | 'scanr' is the right-to-left dual of 'scanl'.</span><span>
</span><span id="line-244"></span><span class="hs-comment">-- Note that</span><span>
</span><span id="line-245"></span><span class="hs-comment">--</span><span>
</span><span id="line-246"></span><span class="hs-comment">-- &gt; head (scanr f z xs) == foldr f z xs.</span><span>
</span><span id="line-247"></span><span id="local-6989586621679567378"><span id="local-6989586621679567379"><span id="local-6989586621679567380"><span class="annot"><a href="Data.List.NonEmpty.html#scanr"><span class="hs-identifier hs-type">scanr</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567380"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567379"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567378"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567378"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567378"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567380"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567379"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567378"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-248"></span><span id="scanr"><span class="annot"><span class="annottext">scanr :: forall (f :: * -&gt; *) a b.
Foldable f =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; f a -&gt; NonEmpty b
</span><a href="Data.List.NonEmpty.html#scanr"><span class="hs-identifier hs-var hs-var">scanr</span></a></span></span><span> </span><span id="local-6989586621679567073"><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679567073"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679567072"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679567072"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[b] -&gt; NonEmpty b
forall a. [a] -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var">fromList</span></a></span><span> </span><span class="annot"><span class="annottext">([b] -&gt; NonEmpty b) -&gt; (f a -&gt; [b]) -&gt; f a -&gt; NonEmpty b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; [b]
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; [b]
</span><a href="GHC.List.html#scanr"><span class="hs-identifier hs-var">List.scanr</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679567073"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679567072"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [b]) -&gt; (f a -&gt; [a]) -&gt; f a -&gt; [b]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">f a -&gt; [a]
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; [a]
</span><a href="Data.Foldable.html#toList"><span class="hs-identifier hs-var">Foldable.toList</span></a></span><span>
</span><span id="line-249"></span><span>
</span><span id="line-250"></span><span class="hs-comment">-- | 'scanl1' is a variant of 'scanl' that has no starting value argument:</span><span>
</span><span id="line-251"></span><span class="hs-comment">--</span><span>
</span><span id="line-252"></span><span class="hs-comment">-- &gt; scanl1 f [x1, x2, ...] == x1 :| [x1 `f` x2, x1 `f` (x2 `f` x3), ...]</span><span>
</span><span id="line-253"></span><span id="local-6989586621679567372"><span class="annot"><a href="Data.List.NonEmpty.html#scanl1"><span class="hs-identifier hs-type">scanl1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567372"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567372"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567372"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567372"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567372"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-254"></span><span id="scanl1"><span class="annot"><span class="annottext">scanl1 :: forall a. (a -&gt; a -&gt; a) -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#scanl1"><span class="hs-identifier hs-var hs-var">scanl1</span></a></span></span><span> </span><span id="local-6989586621679567071"><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679567071"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679567070"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567070"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679567069"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567069"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; NonEmpty a
forall a. [a] -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var">fromList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; a -&gt; a) -&gt; a -&gt; [a] -&gt; [a]
forall b a. (b -&gt; a -&gt; b) -&gt; b -&gt; [a] -&gt; [b]
</span><a href="GHC.List.html#scanl"><span class="hs-identifier hs-var">List.scanl</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679567071"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567070"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567069"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-255"></span><span>
</span><span id="line-256"></span><span class="hs-comment">-- | 'scanr1' is a variant of 'scanr' that has no starting value argument.</span><span>
</span><span id="line-257"></span><span id="local-6989586621679567068"><span class="annot"><a href="Data.List.NonEmpty.html#scanr1"><span class="hs-identifier hs-type">scanr1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567068"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567068"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567068"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567068"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567068"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-258"></span><span id="scanr1"><span class="annot"><span class="annottext">scanr1 :: forall a. (a -&gt; a -&gt; a) -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#scanr1"><span class="hs-identifier hs-var hs-var">scanr1</span></a></span></span><span> </span><span id="local-6989586621679567067"><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679567067"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679567066"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567066"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679567065"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567065"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; NonEmpty a
forall a. [a] -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var">fromList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; a -&gt; a) -&gt; [a] -&gt; [a]
forall a. (a -&gt; a -&gt; a) -&gt; [a] -&gt; [a]
</span><a href="GHC.List.html#scanr1"><span class="hs-identifier hs-var">List.scanr1</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679567067"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567066"><span class="hs-identifier hs-var">a</span></a></span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567065"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-259"></span><span>
</span><span id="line-260"></span><span class="hs-comment">-- | 'intersperse x xs' alternates elements of the list with copies of @x@.</span><span>
</span><span id="line-261"></span><span class="hs-comment">--</span><span>
</span><span id="line-262"></span><span class="hs-comment">-- &gt; intersperse 0 (1 :| [2,3]) == 1 :| [0,2,0,3]</span><span>
</span><span id="line-263"></span><span id="local-6989586621679567064"><span class="annot"><a href="Data.List.NonEmpty.html#intersperse"><span class="hs-identifier hs-type">intersperse</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679567064"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567064"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567064"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-264"></span><span id="intersperse"><span class="annot"><span class="annottext">intersperse :: forall a. a -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#intersperse"><span class="hs-identifier hs-var hs-var">intersperse</span></a></span></span><span> </span><span id="local-6989586621679567063"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567063"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679567062"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567062"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679567061"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567061"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567062"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567061"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-265"></span><span>    </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-266"></span><span>    </span><span class="annot"><span class="annottext">[a]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567063"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="Data.OldList.html#intersperse"><span class="hs-identifier hs-var">List.intersperse</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567063"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567061"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span class="hs-comment">-- | @'iterate' f x@ produces the infinite sequence</span><span>
</span><span id="line-269"></span><span class="hs-comment">-- of repeated applications of @f@ to @x@.</span><span>
</span><span id="line-270"></span><span class="hs-comment">--</span><span>
</span><span id="line-271"></span><span class="hs-comment">-- &gt; iterate f x = x :| [f x, f (f x), ..]</span><span>
</span><span id="line-272"></span><span id="local-6989586621679567367"><span class="annot"><a href="Data.List.NonEmpty.html#iterate"><span class="hs-identifier hs-type">iterate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567367"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567367"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567367"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567367"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-273"></span><span id="iterate"><span class="annot"><span class="annottext">iterate :: forall a. (a -&gt; a) -&gt; a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#iterate"><span class="hs-identifier hs-var hs-var">iterate</span></a></span></span><span> </span><span id="local-6989586621679567059"><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679567059"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679567058"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567058"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567058"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; a) -&gt; a -&gt; [a]
forall a. (a -&gt; a) -&gt; a -&gt; [a]
</span><a href="GHC.List.html#iterate"><span class="hs-identifier hs-var">List.iterate</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679567059"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679567059"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567058"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-274"></span><span>
</span><span id="line-275"></span><span class="hs-comment">-- | @'cycle' xs@ returns the infinite repetition of @xs@:</span><span>
</span><span id="line-276"></span><span class="hs-comment">--</span><span>
</span><span id="line-277"></span><span class="hs-comment">-- &gt; cycle (1 :| [2,3]) = 1 :| [2,3,1,2,3,...]</span><span>
</span><span id="line-278"></span><span id="local-6989586621679567364"><span class="annot"><a href="Data.List.NonEmpty.html#cycle"><span class="hs-identifier hs-type">cycle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567364"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567364"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-279"></span><span id="cycle"><span class="annot"><span class="annottext">cycle :: forall a. NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#cycle"><span class="hs-identifier hs-var hs-var">cycle</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; NonEmpty a
forall a. [a] -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var">fromList</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; NonEmpty a)
-&gt; (NonEmpty a -&gt; [a]) -&gt; NonEmpty a -&gt; NonEmpty a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. [a] -&gt; [a]
</span><a href="GHC.List.html#cycle"><span class="hs-identifier hs-var">List.cycle</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [a]) -&gt; (NonEmpty a -&gt; [a]) -&gt; NonEmpty a -&gt; [a]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; [a]
forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span>
</span><span id="line-280"></span><span>
</span><span id="line-281"></span><span class="hs-comment">-- | 'reverse' a finite NonEmpty stream.</span><span>
</span><span id="line-282"></span><span id="local-6989586621679567057"><span class="annot"><a href="Data.List.NonEmpty.html#reverse"><span class="hs-identifier hs-type">reverse</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567057"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567057"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-283"></span><span id="reverse"><span class="annot"><span class="annottext">reverse :: forall a. NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#reverse"><span class="hs-identifier hs-var hs-var">reverse</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [a]) -&gt; NonEmpty a -&gt; NonEmpty a
forall (f :: * -&gt; *) a b.
Foldable f =&gt;
([a] -&gt; [b]) -&gt; f a -&gt; NonEmpty b
</span><a href="Data.List.NonEmpty.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. [a] -&gt; [a]
</span><a href="GHC.List.html#reverse"><span class="hs-identifier hs-var">List.reverse</span></a></span><span>
</span><span id="line-284"></span><span>
</span><span id="line-285"></span><span class="hs-comment">-- | @'repeat' x@ returns a constant stream, where all elements are</span><span>
</span><span id="line-286"></span><span class="hs-comment">-- equal to @x@.</span><span>
</span><span id="line-287"></span><span id="local-6989586621679567055"><span class="annot"><a href="Data.List.NonEmpty.html#repeat"><span class="hs-identifier hs-type">repeat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679567055"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567055"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-288"></span><span id="repeat"><span class="annot"><span class="annottext">repeat :: forall a. a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#repeat"><span class="hs-identifier hs-var hs-var">repeat</span></a></span></span><span> </span><span id="local-6989586621679567054"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567054"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567054"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a]
forall a. a -&gt; [a]
</span><a href="GHC.List.html#repeat"><span class="hs-identifier hs-var">List.repeat</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567054"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-289"></span><span>
</span><span id="line-290"></span><span class="hs-comment">-- | @'take' n xs@ returns the first @n@ elements of @xs@.</span><span>
</span><span id="line-291"></span><span id="local-6989586621679567359"><span class="annot"><a href="Data.List.NonEmpty.html#take"><span class="hs-identifier hs-type">take</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567359"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567359"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-292"></span><span id="take"><span class="annot"><span class="annottext">take :: forall a. Int -&gt; NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#take"><span class="hs-identifier hs-var hs-var">take</span></a></span></span><span> </span><span id="local-6989586621679567053"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679567053"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [a] -&gt; [a]
forall a. Int -&gt; [a] -&gt; [a]
</span><a href="GHC.List.html#take"><span class="hs-identifier hs-var">List.take</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679567053"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [a]) -&gt; (NonEmpty a -&gt; [a]) -&gt; NonEmpty a -&gt; [a]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; [a]
forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span class="hs-comment">-- | @'drop' n xs@ drops the first @n@ elements off the front of</span><span>
</span><span id="line-295"></span><span class="hs-comment">-- the sequence @xs@.</span><span>
</span><span id="line-296"></span><span id="local-6989586621679567052"><span class="annot"><a href="Data.List.NonEmpty.html#drop"><span class="hs-identifier hs-type">drop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567052"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567052"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-297"></span><span id="drop"><span class="annot"><span class="annottext">drop :: forall a. Int -&gt; NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#drop"><span class="hs-identifier hs-var hs-var">drop</span></a></span></span><span> </span><span id="local-6989586621679567051"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679567051"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [a] -&gt; [a]
forall a. Int -&gt; [a] -&gt; [a]
</span><a href="GHC.List.html#drop"><span class="hs-identifier hs-var">List.drop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679567051"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [a]) -&gt; (NonEmpty a -&gt; [a]) -&gt; NonEmpty a -&gt; [a]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; [a]
forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span>
</span><span id="line-298"></span><span>
</span><span id="line-299"></span><span class="hs-comment">-- | @'splitAt' n xs@ returns a pair consisting of the prefix of @xs@</span><span>
</span><span id="line-300"></span><span class="hs-comment">-- of length @n@ and the remaining stream immediately following this prefix.</span><span>
</span><span id="line-301"></span><span class="hs-comment">--</span><span>
</span><span id="line-302"></span><span class="hs-comment">-- &gt; 'splitAt' n xs == ('take' n xs, 'drop' n xs)</span><span>
</span><span id="line-303"></span><span class="hs-comment">-- &gt; xs == ys ++ zs where (ys, zs) = 'splitAt' n xs</span><span>
</span><span id="line-304"></span><span id="local-6989586621679567355"><span class="annot"><a href="Data.List.NonEmpty.html#splitAt"><span class="hs-identifier hs-type">splitAt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567355"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567355"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567355"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-305"></span><span id="splitAt"><span class="annot"><span class="annottext">splitAt :: forall a. Int -&gt; NonEmpty a -&gt; ([a], [a])
</span><a href="Data.List.NonEmpty.html#splitAt"><span class="hs-identifier hs-var hs-var">splitAt</span></a></span></span><span> </span><span id="local-6989586621679567050"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679567050"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [a] -&gt; ([a], [a])
forall a. Int -&gt; [a] -&gt; ([a], [a])
</span><a href="GHC.List.html#splitAt"><span class="hs-identifier hs-var">List.splitAt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679567050"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; ([a], [a]))
-&gt; (NonEmpty a -&gt; [a]) -&gt; NonEmpty a -&gt; ([a], [a])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; [a]
forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span>
</span><span id="line-306"></span><span>
</span><span id="line-307"></span><span class="hs-comment">-- | @'takeWhile' p xs@ returns the longest prefix of the stream</span><span>
</span><span id="line-308"></span><span class="hs-comment">-- @xs@ for which the predicate @p@ holds.</span><span>
</span><span id="line-309"></span><span id="local-6989586621679567352"><span class="annot"><a href="Data.List.NonEmpty.html#takeWhile"><span class="hs-identifier hs-type">takeWhile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567352"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567352"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567352"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-310"></span><span id="takeWhile"><span class="annot"><span class="annottext">takeWhile :: forall a. (a -&gt; Bool) -&gt; NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#takeWhile"><span class="hs-identifier hs-var hs-var">takeWhile</span></a></span></span><span> </span><span id="local-6989586621679567049"><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679567049"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Bool) -&gt; [a] -&gt; [a]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.List.html#takeWhile"><span class="hs-identifier hs-var">List.takeWhile</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679567049"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [a]) -&gt; (NonEmpty a -&gt; [a]) -&gt; NonEmpty a -&gt; [a]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; [a]
forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span>
</span><span id="line-311"></span><span>
</span><span id="line-312"></span><span class="hs-comment">-- | @'dropWhile' p xs@ returns the suffix remaining after</span><span>
</span><span id="line-313"></span><span class="hs-comment">-- @'takeWhile' p xs@.</span><span>
</span><span id="line-314"></span><span id="local-6989586621679567048"><span class="annot"><a href="Data.List.NonEmpty.html#dropWhile"><span class="hs-identifier hs-type">dropWhile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567048"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567048"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567048"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-315"></span><span id="dropWhile"><span class="annot"><span class="annottext">dropWhile :: forall a. (a -&gt; Bool) -&gt; NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#dropWhile"><span class="hs-identifier hs-var hs-var">dropWhile</span></a></span></span><span> </span><span id="local-6989586621679567047"><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679567047"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Bool) -&gt; [a] -&gt; [a]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.List.html#dropWhile"><span class="hs-identifier hs-var">List.dropWhile</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679567047"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [a]) -&gt; (NonEmpty a -&gt; [a]) -&gt; NonEmpty a -&gt; [a]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; [a]
forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span>
</span><span id="line-316"></span><span>
</span><span id="line-317"></span><span class="hs-comment">-- | @'span' p xs@ returns the longest prefix of @xs@ that satisfies</span><span>
</span><span id="line-318"></span><span class="hs-comment">-- @p@, together with the remainder of the stream.</span><span>
</span><span id="line-319"></span><span class="hs-comment">--</span><span>
</span><span id="line-320"></span><span class="hs-comment">-- &gt; 'span' p xs == ('takeWhile' p xs, 'dropWhile' p xs)</span><span>
</span><span id="line-321"></span><span class="hs-comment">-- &gt; xs == ys ++ zs where (ys, zs) = 'span' p xs</span><span>
</span><span id="line-322"></span><span id="local-6989586621679567348"><span class="annot"><a href="Data.List.NonEmpty.html#span"><span class="hs-identifier hs-type">span</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567348"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567348"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567348"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567348"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-323"></span><span id="span"><span class="annot"><span class="annottext">span :: forall a. (a -&gt; Bool) -&gt; NonEmpty a -&gt; ([a], [a])
</span><a href="Data.List.NonEmpty.html#span"><span class="hs-identifier hs-var hs-var">span</span></a></span></span><span> </span><span id="local-6989586621679567046"><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679567046"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="GHC.List.html#span"><span class="hs-identifier hs-var">List.span</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679567046"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; ([a], [a]))
-&gt; (NonEmpty a -&gt; [a]) -&gt; NonEmpty a -&gt; ([a], [a])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; [a]
forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span>
</span><span id="line-324"></span><span>
</span><span id="line-325"></span><span class="hs-comment">-- | The @'break' p@ function is equivalent to @'span' (not . p)@.</span><span>
</span><span id="line-326"></span><span id="local-6989586621679567045"><span class="annot"><a href="Data.List.NonEmpty.html#break"><span class="hs-identifier hs-type">break</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567045"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567045"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567045"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567045"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-327"></span><span id="break"><span class="annot"><span class="annottext">break :: forall a. (a -&gt; Bool) -&gt; NonEmpty a -&gt; ([a], [a])
</span><a href="Data.List.NonEmpty.html#break"><span class="hs-identifier hs-var hs-var">break</span></a></span></span><span> </span><span id="local-6989586621679567044"><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679567044"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Bool) -&gt; NonEmpty a -&gt; ([a], [a])
forall a. (a -&gt; Bool) -&gt; NonEmpty a -&gt; ([a], [a])
</span><a href="Data.List.NonEmpty.html#span"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#not"><span class="hs-identifier hs-var">not</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (a -&gt; Bool) -&gt; a -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679567044"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-328"></span><span>
</span><span id="line-329"></span><span class="hs-comment">-- | @'filter' p xs@ removes any elements from @xs@ that do not satisfy @p@.</span><span>
</span><span id="line-330"></span><span id="local-6989586621679567043"><span class="annot"><a href="Data.List.NonEmpty.html#filter"><span class="hs-identifier hs-type">filter</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567043"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567043"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567043"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-331"></span><span id="filter"><span class="annot"><span class="annottext">filter :: forall a. (a -&gt; Bool) -&gt; NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#filter"><span class="hs-identifier hs-var hs-var">filter</span></a></span></span><span> </span><span id="local-6989586621679567042"><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679567042"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Bool) -&gt; [a] -&gt; [a]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.List.html#filter"><span class="hs-identifier hs-var">List.filter</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679567042"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [a]) -&gt; (NonEmpty a -&gt; [a]) -&gt; NonEmpty a -&gt; [a]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; [a]
forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span>
</span><span id="line-332"></span><span>
</span><span id="line-333"></span><span class="hs-comment">-- | The 'partition' function takes a predicate @p@ and a stream</span><span>
</span><span id="line-334"></span><span class="hs-comment">-- @xs@, and returns a pair of lists. The first list corresponds to the</span><span>
</span><span id="line-335"></span><span class="hs-comment">-- elements of @xs@ for which @p@ holds; the second corresponds to the</span><span>
</span><span id="line-336"></span><span class="hs-comment">-- elements of @xs@ for which @p@ does not hold.</span><span>
</span><span id="line-337"></span><span class="hs-comment">--</span><span>
</span><span id="line-338"></span><span class="hs-comment">-- &gt; 'partition' p xs = ('filter' p xs, 'filter' (not . p) xs)</span><span>
</span><span id="line-339"></span><span id="local-6989586621679567041"><span class="annot"><a href="Data.List.NonEmpty.html#partition"><span class="hs-identifier hs-type">partition</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567041"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567041"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567041"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567041"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-340"></span><span id="partition"><span class="annot"><span class="annottext">partition :: forall a. (a -&gt; Bool) -&gt; NonEmpty a -&gt; ([a], [a])
</span><a href="Data.List.NonEmpty.html#partition"><span class="hs-identifier hs-var hs-var">partition</span></a></span></span><span> </span><span id="local-6989586621679567040"><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679567040"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="Data.OldList.html#partition"><span class="hs-identifier hs-var">List.partition</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679567040"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; ([a], [a]))
-&gt; (NonEmpty a -&gt; [a]) -&gt; NonEmpty a -&gt; ([a], [a])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; [a]
forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span>
</span><span id="line-341"></span><span>
</span><span id="line-342"></span><span class="hs-comment">-- | The 'group' function takes a stream and returns a list of</span><span>
</span><span id="line-343"></span><span class="hs-comment">-- streams such that flattening the resulting list is equal to the</span><span>
</span><span id="line-344"></span><span class="hs-comment">-- argument.  Moreover, each stream in the resulting list</span><span>
</span><span id="line-345"></span><span class="hs-comment">-- contains only equal elements.  For example, in list notation:</span><span>
</span><span id="line-346"></span><span class="hs-comment">--</span><span>
</span><span id="line-347"></span><span class="hs-comment">-- &gt; 'group' $ 'cycle' &quot;Mississippi&quot;</span><span>
</span><span id="line-348"></span><span class="hs-comment">-- &gt;   = &quot;M&quot; : &quot;i&quot; : &quot;ss&quot; : &quot;i&quot; : &quot;ss&quot; : &quot;i&quot; : &quot;pp&quot; : &quot;i&quot; : &quot;M&quot; : &quot;i&quot; : ...</span><span>
</span><span id="line-349"></span><span id="local-6989586621679567341"><span id="local-6989586621679567342"><span class="annot"><a href="Data.List.NonEmpty.html#group"><span class="hs-identifier hs-type">group</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567342"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567341"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567342"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567341"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567341"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-350"></span><span id="group"><span class="annot"><span class="annottext">group :: forall (f :: * -&gt; *) a. (Foldable f, Eq a) =&gt; f a -&gt; [NonEmpty a]
</span><a href="Data.List.NonEmpty.html#group"><span class="hs-identifier hs-var hs-var">group</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; Bool) -&gt; f a -&gt; [NonEmpty a]
forall (f :: * -&gt; *) a.
Foldable f =&gt;
(a -&gt; a -&gt; Bool) -&gt; f a -&gt; [NonEmpty a]
</span><a href="Data.List.NonEmpty.html#groupBy"><span class="hs-identifier hs-var">groupBy</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">(==)</span></a></span><span>
</span><span id="line-351"></span><span>
</span><span id="line-352"></span><span class="hs-comment">-- | 'groupBy' operates like 'group', but uses the provided equality</span><span>
</span><span id="line-353"></span><span class="hs-comment">-- predicate instead of `==`.</span><span>
</span><span id="line-354"></span><span id="local-6989586621679567337"><span id="local-6989586621679567338"><span class="annot"><a href="Data.List.NonEmpty.html#groupBy"><span class="hs-identifier hs-type">groupBy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567338"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567337"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567337"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567338"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567337"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567337"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-355"></span><span id="groupBy"><span class="annot"><span class="annottext">groupBy :: forall (f :: * -&gt; *) a.
Foldable f =&gt;
(a -&gt; a -&gt; Bool) -&gt; f a -&gt; [NonEmpty a]
</span><a href="Data.List.NonEmpty.html#groupBy"><span class="hs-identifier hs-var hs-var">groupBy</span></a></span></span><span> </span><span id="local-6989586621679567032"><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621679567032"><span class="hs-identifier hs-var">eq0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; Bool) -&gt; [a] -&gt; [NonEmpty a]
forall {a}. (a -&gt; a -&gt; Bool) -&gt; [a] -&gt; [NonEmpty a]
</span><a href="#local-6989586621679567031"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621679567032"><span class="hs-identifier hs-var">eq0</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [NonEmpty a]) -&gt; (f a -&gt; [a]) -&gt; f a -&gt; [NonEmpty a]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">f a -&gt; [a]
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; [a]
</span><a href="Data.Foldable.html#toList"><span class="hs-identifier hs-var">Foldable.toList</span></a></span><span>
</span><span id="line-356"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-357"></span><span>    </span><span id="local-6989586621679567031"><span class="annot"><span class="annottext">go :: (a -&gt; a -&gt; Bool) -&gt; [a] -&gt; [NonEmpty a]
</span><a href="#local-6989586621679567031"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-358"></span><span>    </span><span class="annot"><a href="#local-6989586621679567031"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621679567029"><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621679567029"><span class="hs-identifier hs-var">eq</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679567028"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567028"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span> </span><span id="local-6989586621679567027"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567027"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567028"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567026"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; [NonEmpty a] -&gt; [NonEmpty a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; Bool) -&gt; [a] -&gt; [NonEmpty a]
forall (f :: * -&gt; *) a.
Foldable f =&gt;
(a -&gt; a -&gt; Bool) -&gt; f a -&gt; [NonEmpty a]
</span><a href="Data.List.NonEmpty.html#groupBy"><span class="hs-identifier hs-var">groupBy</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621679567029"><span class="hs-identifier hs-var">eq</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567025"><span class="hs-identifier hs-var">zs</span></a></span><span>
</span><span id="line-359"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679567026"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567026"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679567025"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567025"><span class="hs-identifier hs-var">zs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="GHC.List.html#span"><span class="hs-identifier hs-var">List.span</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621679567029"><span class="hs-identifier hs-var">eq</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567028"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567027"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-360"></span><span>
</span><span id="line-361"></span><span class="hs-comment">-- | 'groupWith' operates like 'group', but uses the provided projection when</span><span>
</span><span id="line-362"></span><span class="hs-comment">-- comparing for equality</span><span>
</span><span id="line-363"></span><span id="local-6989586621679567330"><span id="local-6989586621679567331"><span id="local-6989586621679567332"><span class="annot"><a href="Data.List.NonEmpty.html#groupWith"><span class="hs-identifier hs-type">groupWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567332"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567331"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567330"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567331"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567332"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567330"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567330"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span></span><span>
</span><span id="line-364"></span><span id="groupWith"><span class="annot"><span class="annottext">groupWith :: forall (f :: * -&gt; *) b a.
(Foldable f, Eq b) =&gt;
(a -&gt; b) -&gt; f a -&gt; [NonEmpty a]
</span><a href="Data.List.NonEmpty.html#groupWith"><span class="hs-identifier hs-var hs-var">groupWith</span></a></span></span><span> </span><span id="local-6989586621679567020"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679567020"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; Bool) -&gt; f a -&gt; [NonEmpty a]
forall (f :: * -&gt; *) a.
Foldable f =&gt;
(a -&gt; a -&gt; Bool) -&gt; f a -&gt; [NonEmpty a]
</span><a href="Data.List.NonEmpty.html#groupBy"><span class="hs-identifier hs-var">groupBy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; b -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">(==)</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; b -&gt; Bool) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; Bool
forall b c a. (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c
</span><a href="Data.Function.html#on"><span class="hs-operator hs-var">`on`</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679567020"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-365"></span><span>
</span><span id="line-366"></span><span class="hs-comment">-- | 'groupAllWith' operates like 'groupWith', but sorts the list</span><span>
</span><span id="line-367"></span><span class="hs-comment">-- first so that each equivalence class has, at most, one list in the</span><span>
</span><span id="line-368"></span><span class="hs-comment">-- output</span><span>
</span><span id="line-369"></span><span id="local-6989586621679567322"><span id="local-6989586621679567323"><span class="annot"><a href="Data.List.NonEmpty.html#groupAllWith"><span class="hs-identifier hs-type">groupAllWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-type">Ord</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567323"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567322"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567323"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567322"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567322"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-370"></span><span id="groupAllWith"><span class="annot"><span class="annottext">groupAllWith :: forall b a. Ord b =&gt; (a -&gt; b) -&gt; [a] -&gt; [NonEmpty a]
</span><a href="Data.List.NonEmpty.html#groupAllWith"><span class="hs-identifier hs-var hs-var">groupAllWith</span></a></span></span><span> </span><span id="local-6989586621679567013"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679567013"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; [a] -&gt; [NonEmpty a]
forall (f :: * -&gt; *) b a.
(Foldable f, Eq b) =&gt;
(a -&gt; b) -&gt; f a -&gt; [NonEmpty a]
</span><a href="Data.List.NonEmpty.html#groupWith"><span class="hs-identifier hs-var">groupWith</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679567013"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [NonEmpty a]) -&gt; ([a] -&gt; [a]) -&gt; [a] -&gt; [NonEmpty a]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; [a]
forall a. (a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; [a]
</span><a href="Data.OldList.html#sortBy"><span class="hs-identifier hs-var">List.sortBy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; b -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><a href="../../ghc-prim/src/GHC.Classes.html#compare"><span class="hs-identifier hs-var">compare</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; b -&gt; Ordering) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; Ordering
forall b c a. (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c
</span><a href="Data.Function.html#on"><span class="hs-operator hs-var">`on`</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679567013"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-371"></span><span>
</span><span id="line-372"></span><span class="hs-comment">-- | 'group1' operates like 'group', but uses the knowledge that its</span><span>
</span><span id="line-373"></span><span class="hs-comment">-- input is non-empty to produce guaranteed non-empty output.</span><span>
</span><span id="line-374"></span><span id="local-6989586621679567317"><span class="annot"><a href="Data.List.NonEmpty.html#group1"><span class="hs-identifier hs-type">group1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567317"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567317"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567317"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-375"></span><span id="group1"><span class="annot"><span class="annottext">group1 :: forall a. Eq a =&gt; NonEmpty a -&gt; NonEmpty (NonEmpty a)
</span><a href="Data.List.NonEmpty.html#group1"><span class="hs-identifier hs-var hs-var">group1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; Bool) -&gt; NonEmpty a -&gt; NonEmpty (NonEmpty a)
forall a. (a -&gt; a -&gt; Bool) -&gt; NonEmpty a -&gt; NonEmpty (NonEmpty a)
</span><a href="Data.List.NonEmpty.html#groupBy1"><span class="hs-identifier hs-var">groupBy1</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">(==)</span></a></span><span>
</span><span id="line-376"></span><span>
</span><span id="line-377"></span><span class="hs-comment">-- | 'groupBy1' is to 'group1' as 'groupBy' is to 'group'.</span><span>
</span><span id="line-378"></span><span id="local-6989586621679567315"><span class="annot"><a href="Data.List.NonEmpty.html#groupBy1"><span class="hs-identifier hs-type">groupBy1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567315"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567315"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567315"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567315"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-379"></span><span id="groupBy1"><span class="annot"><span class="annottext">groupBy1 :: forall a. (a -&gt; a -&gt; Bool) -&gt; NonEmpty a -&gt; NonEmpty (NonEmpty a)
</span><a href="Data.List.NonEmpty.html#groupBy1"><span class="hs-identifier hs-var hs-var">groupBy1</span></a></span></span><span> </span><span id="local-6989586621679567007"><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621679567007"><span class="hs-identifier hs-var">eq</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679567006"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567006"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679567005"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567005"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567006"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567004"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; [NonEmpty a] -&gt; NonEmpty (NonEmpty a)
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; Bool) -&gt; [a] -&gt; [NonEmpty a]
forall (f :: * -&gt; *) a.
Foldable f =&gt;
(a -&gt; a -&gt; Bool) -&gt; f a -&gt; [NonEmpty a]
</span><a href="Data.List.NonEmpty.html#groupBy"><span class="hs-identifier hs-var">groupBy</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621679567007"><span class="hs-identifier hs-var">eq</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567003"><span class="hs-identifier hs-var">zs</span></a></span><span>
</span><span id="line-380"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679567004"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567004"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679567003"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567003"><span class="hs-identifier hs-var">zs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="GHC.List.html#span"><span class="hs-identifier hs-var">List.span</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621679567007"><span class="hs-identifier hs-var">eq</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679567006"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679567005"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-381"></span><span>
</span><span id="line-382"></span><span class="hs-comment">-- | 'groupWith1' is to 'group1' as 'groupWith' is to 'group'</span><span>
</span><span id="line-383"></span><span id="local-6989586621679567312"><span id="local-6989586621679567313"><span class="annot"><a href="Data.List.NonEmpty.html#groupWith1"><span class="hs-identifier hs-type">groupWith1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567313"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567312"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567313"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567312"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567312"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-384"></span><span id="groupWith1"><span class="annot"><span class="annottext">groupWith1 :: forall b a. Eq b =&gt; (a -&gt; b) -&gt; NonEmpty a -&gt; NonEmpty (NonEmpty a)
</span><a href="Data.List.NonEmpty.html#groupWith1"><span class="hs-identifier hs-var hs-var">groupWith1</span></a></span></span><span> </span><span id="local-6989586621679567000"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679567000"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; Bool) -&gt; NonEmpty a -&gt; NonEmpty (NonEmpty a)
forall a. (a -&gt; a -&gt; Bool) -&gt; NonEmpty a -&gt; NonEmpty (NonEmpty a)
</span><a href="Data.List.NonEmpty.html#groupBy1"><span class="hs-identifier hs-var">groupBy1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; b -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">(==)</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; b -&gt; Bool) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; Bool
forall b c a. (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c
</span><a href="Data.Function.html#on"><span class="hs-operator hs-var">`on`</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679567000"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-385"></span><span>
</span><span id="line-386"></span><span class="hs-comment">-- | 'groupAllWith1' is to 'groupWith1' as 'groupAllWith' is to 'groupWith'</span><span>
</span><span id="line-387"></span><span id="local-6989586621679567308"><span id="local-6989586621679567309"><span class="annot"><a href="Data.List.NonEmpty.html#groupAllWith1"><span class="hs-identifier hs-type">groupAllWith1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-type">Ord</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567309"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567308"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567309"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567308"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567308"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-388"></span><span id="groupAllWith1"><span class="annot"><span class="annottext">groupAllWith1 :: forall b a.
Ord b =&gt;
(a -&gt; b) -&gt; NonEmpty a -&gt; NonEmpty (NonEmpty a)
</span><a href="Data.List.NonEmpty.html#groupAllWith1"><span class="hs-identifier hs-var hs-var">groupAllWith1</span></a></span></span><span> </span><span id="local-6989586621679566995"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679566995"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; NonEmpty a -&gt; NonEmpty (NonEmpty a)
forall b a. Eq b =&gt; (a -&gt; b) -&gt; NonEmpty a -&gt; NonEmpty (NonEmpty a)
</span><a href="Data.List.NonEmpty.html#groupWith1"><span class="hs-identifier hs-var">groupWith1</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679566995"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(NonEmpty a -&gt; NonEmpty (NonEmpty a))
-&gt; (NonEmpty a -&gt; NonEmpty a)
-&gt; NonEmpty a
-&gt; NonEmpty (NonEmpty a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; NonEmpty a -&gt; NonEmpty a
forall o a. Ord o =&gt; (a -&gt; o) -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#sortWith"><span class="hs-identifier hs-var">sortWith</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679566995"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-389"></span><span>
</span><span id="line-390"></span><span class="hs-comment">-- | The 'isPrefixOf' function returns 'True' if the first argument is</span><span>
</span><span id="line-391"></span><span class="hs-comment">-- a prefix of the second.</span><span>
</span><span id="line-392"></span><span id="local-6989586621679567303"><span class="annot"><a href="Data.List.NonEmpty.html#isPrefixOf"><span class="hs-identifier hs-type">isPrefixOf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567303"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679567303"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567303"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span></span><span>
</span><span id="line-393"></span><span id="isPrefixOf"><span class="annot"><span class="annottext">isPrefixOf :: forall a. Eq a =&gt; [a] -&gt; NonEmpty a -&gt; Bool
</span><a href="Data.List.NonEmpty.html#isPrefixOf"><span class="hs-identifier hs-var hs-var">isPrefixOf</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">NonEmpty a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-394"></span><span class="annot"><a href="Data.List.NonEmpty.html#isPrefixOf"><span class="hs-identifier hs-var">isPrefixOf</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679566991"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566991"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679566990"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679566990"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679566989"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566989"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679566988"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679566988"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566991"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566989"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; Bool
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; Bool
</span><a href="Data.OldList.html#isPrefixOf"><span class="hs-identifier hs-var">List.isPrefixOf</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679566990"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679566988"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-395"></span><span>
</span><span id="line-396"></span><span class="hs-comment">-- | @xs !! n@ returns the element of the stream @xs@ at index</span><span>
</span><span id="line-397"></span><span class="hs-comment">-- @n@. Note that the head of the stream has index 0.</span><span>
</span><span id="line-398"></span><span class="hs-comment">--</span><span>
</span><span id="line-399"></span><span class="hs-comment">-- /Beware/: a negative or out-of-bounds index will cause an error.</span><span>
</span><span id="line-400"></span><span id="local-6989586621679567300"><span class="annot"><a href="Data.List.NonEmpty.html#%21%21"><span class="hs-operator hs-type">(!!)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567300"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567300"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-401"></span><span id="%21%21"><span class="annot"><span class="annottext">!! :: forall a. NonEmpty a -&gt; Int -&gt; a
</span><a href="Data.List.NonEmpty.html#%21%21"><span class="hs-operator hs-var hs-var">(!!)</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679566977"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566977"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679566976"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679566976"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679566975"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679566975"><span class="hs-identifier hs-var">n</span></a></span></span><span>
</span><span id="line-402"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679566975"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566977"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-403"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679566975"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E"><span class="hs-operator hs-var">&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679566976"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; Int -&gt; a
forall a. [a] -&gt; Int -&gt; a
</span><a href="GHC.List.html#%21%21"><span class="hs-operator hs-var">List.!!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679566975"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-404"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; a
forall a. [Char] -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;NonEmpty.!! negative argument&quot;</span></span><span>
</span><span id="line-405"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">9</span><span> </span><span class="annot"><a href="Data.List.NonEmpty.html#%21%21"><span class="hs-operator hs-type">!!</span></a></span><span>
</span><span id="line-406"></span><span>
</span><span id="line-407"></span><span class="hs-comment">-- | The 'zip' function takes two streams and returns a stream of</span><span>
</span><span id="line-408"></span><span class="hs-comment">-- corresponding pairs.</span><span>
</span><span id="line-409"></span><span id="local-6989586621679567296"><span id="local-6989586621679567297"><span class="annot"><a href="Data.List.NonEmpty.html#zip"><span class="hs-identifier hs-type">zip</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567297"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567296"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567297"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679567296"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-410"></span><span id="zip"><span class="annot"><span class="annottext">zip :: forall a b. NonEmpty a -&gt; NonEmpty b -&gt; NonEmpty (a, b)
</span><a href="Data.List.NonEmpty.html#zip"><span class="hs-identifier hs-var hs-var">zip</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679566973"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566973"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679566972"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679566972"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679566971"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679566971"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679566970"><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679566970"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566973"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679566971"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(a, b) -&gt; [(a, b)] -&gt; NonEmpty (a, b)
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [b] -&gt; [(a, b)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="GHC.List.html#zip"><span class="hs-identifier hs-var">List.zip</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679566972"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679566970"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-411"></span><span>
</span><span id="line-412"></span><span class="hs-comment">-- | The 'zipWith' function generalizes 'zip'. Rather than tupling</span><span>
</span><span id="line-413"></span><span class="hs-comment">-- the elements, the elements are combined using the function</span><span>
</span><span id="line-414"></span><span class="hs-comment">-- passed as the first argument.</span><span>
</span><span id="line-415"></span><span id="local-6989586621679567289"><span id="local-6989586621679567290"><span id="local-6989586621679567291"><span class="annot"><a href="Data.List.NonEmpty.html#zipWith"><span class="hs-identifier hs-type">zipWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567291"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567290"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567289"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567291"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567290"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567289"><span class="hs-identifier hs-type">c</span></a></span></span></span></span><span>
</span><span id="line-416"></span><span id="zipWith"><span class="annot"><span class="annottext">zipWith :: forall a b c.
(a -&gt; b -&gt; c) -&gt; NonEmpty a -&gt; NonEmpty b -&gt; NonEmpty c
</span><a href="Data.List.NonEmpty.html#zipWith"><span class="hs-identifier hs-var hs-var">zipWith</span></a></span></span><span> </span><span id="local-6989586621679566969"><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679566969"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679566968"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566968"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679566967"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679566967"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679566966"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679566966"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679566965"><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679566965"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679566969"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566968"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679566966"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">c -&gt; [c] -&gt; NonEmpty c
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
forall a b c. (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="GHC.List.html#zipWith"><span class="hs-identifier hs-var">List.zipWith</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679566969"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679566967"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679566965"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span class="hs-comment">-- | The 'unzip' function is the inverse of the 'zip' function.</span><span>
</span><span id="line-419"></span><span id="local-6989586621679567280"><span id="local-6989586621679567281"><span id="local-6989586621679567282"><span class="annot"><a href="Data.List.NonEmpty.html#unzip"><span class="hs-identifier hs-type">unzip</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567282"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567282"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567281"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679567280"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567282"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567281"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679567282"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567280"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-420"></span><span id="unzip"><span class="annot"><span class="annottext">unzip :: forall (f :: * -&gt; *) a b. Functor f =&gt; f (a, b) -&gt; (f a, f b)
</span><a href="Data.List.NonEmpty.html#unzip"><span class="hs-identifier hs-var hs-var">unzip</span></a></span></span><span> </span><span id="local-6989586621679566961"><span class="annot"><span class="annottext">f (a, b)
</span><a href="#local-6989586621679566961"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a, b) -&gt; a
forall a b. (a, b) -&gt; a
</span><a href="Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">((a, b) -&gt; a) -&gt; f (a, b) -&gt; f a
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">f (a, b)
</span><a href="#local-6989586621679566961"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(a, b) -&gt; b
forall a b. (a, b) -&gt; b
</span><a href="Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">((a, b) -&gt; b) -&gt; f (a, b) -&gt; f b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">f (a, b)
</span><a href="#local-6989586621679566961"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-421"></span><span>
</span><span id="line-422"></span><span class="hs-comment">-- | The 'nub' function removes duplicate elements from a list. In</span><span>
</span><span id="line-423"></span><span class="hs-comment">-- particular, it keeps only the first occurrence of each element.</span><span>
</span><span id="line-424"></span><span class="hs-comment">-- (The name 'nub' means \'essence\'.)</span><span>
</span><span id="line-425"></span><span class="hs-comment">-- It is a special case of 'nubBy', which allows the programmer to</span><span>
</span><span id="line-426"></span><span class="hs-comment">-- supply their own inequality test.</span><span>
</span><span id="line-427"></span><span id="local-6989586621679567269"><span class="annot"><a href="Data.List.NonEmpty.html#nub"><span class="hs-identifier hs-type">nub</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567269"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567269"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567269"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-428"></span><span id="nub"><span class="annot"><span class="annottext">nub :: forall a. Eq a =&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#nub"><span class="hs-identifier hs-var hs-var">nub</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; Bool) -&gt; NonEmpty a -&gt; NonEmpty a
forall a. (a -&gt; a -&gt; Bool) -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#nubBy"><span class="hs-identifier hs-var">nubBy</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">(==)</span></a></span><span>
</span><span id="line-429"></span><span>
</span><span id="line-430"></span><span class="hs-comment">-- | The 'nubBy' function behaves just like 'nub', except it uses a</span><span>
</span><span id="line-431"></span><span class="hs-comment">-- user-supplied equality predicate instead of the overloaded '=='</span><span>
</span><span id="line-432"></span><span class="hs-comment">-- function.</span><span>
</span><span id="line-433"></span><span id="local-6989586621679567267"><span class="annot"><a href="Data.List.NonEmpty.html#nubBy"><span class="hs-identifier hs-type">nubBy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567267"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567267"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567267"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567267"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-434"></span><span id="nubBy"><span class="annot"><span class="annottext">nubBy :: forall a. (a -&gt; a -&gt; Bool) -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#nubBy"><span class="hs-identifier hs-var hs-var">nubBy</span></a></span></span><span> </span><span id="local-6989586621679566957"><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621679566957"><span class="hs-identifier hs-var">eq</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679566956"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566956"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679566955"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679566955"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566956"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; Bool) -&gt; [a] -&gt; [a]
forall a. (a -&gt; a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="Data.OldList.html#nubBy"><span class="hs-identifier hs-var">List.nubBy</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621679566957"><span class="hs-identifier hs-var">eq</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; Bool) -&gt; [a] -&gt; [a]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.List.html#filter"><span class="hs-identifier hs-var">List.filter</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679566953"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566953"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#not"><span class="hs-identifier hs-var">not</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621679566957"><span class="hs-identifier hs-var">eq</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566956"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679566953"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679566955"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-435"></span><span>
</span><span id="line-436"></span><span class="hs-comment">-- | 'transpose' for 'NonEmpty', behaves the same as 'Data.List.transpose'</span><span>
</span><span id="line-437"></span><span class="hs-comment">-- The rows/columns need not be the same length, in which case</span><span>
</span><span id="line-438"></span><span class="hs-comment">-- &gt; transpose . transpose /= id</span><span>
</span><span id="line-439"></span><span id="local-6989586621679567264"><span class="annot"><a href="Data.List.NonEmpty.html#transpose"><span class="hs-identifier hs-type">transpose</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567264"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567264"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-440"></span><span id="transpose"><span class="annot"><span class="annottext">transpose :: forall a. NonEmpty (NonEmpty a) -&gt; NonEmpty (NonEmpty a)
</span><a href="Data.List.NonEmpty.html#transpose"><span class="hs-identifier hs-var hs-var">transpose</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([a] -&gt; NonEmpty a) -&gt; NonEmpty [a] -&gt; NonEmpty (NonEmpty a)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; NonEmpty a
forall a. [a] -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var">fromList</span></a></span><span>
</span><span id="line-441"></span><span>          </span><span class="annot"><span class="annottext">(NonEmpty [a] -&gt; NonEmpty (NonEmpty a))
-&gt; (NonEmpty (NonEmpty a) -&gt; NonEmpty [a])
-&gt; NonEmpty (NonEmpty a)
-&gt; NonEmpty (NonEmpty a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[[a]] -&gt; NonEmpty [a]
forall a. [a] -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var">fromList</span></a></span><span> </span><span class="annot"><span class="annottext">([[a]] -&gt; NonEmpty [a])
-&gt; (NonEmpty (NonEmpty a) -&gt; [[a]])
-&gt; NonEmpty (NonEmpty a)
-&gt; NonEmpty [a]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[[a]] -&gt; [[a]]
forall a. [[a]] -&gt; [[a]]
</span><a href="Data.OldList.html#transpose"><span class="hs-identifier hs-var">List.transpose</span></a></span><span> </span><span class="annot"><span class="annottext">([[a]] -&gt; [[a]])
-&gt; (NonEmpty (NonEmpty a) -&gt; [[a]])
-&gt; NonEmpty (NonEmpty a)
-&gt; [[a]]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty [a] -&gt; [[a]]
forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span>
</span><span id="line-442"></span><span>          </span><span class="annot"><span class="annottext">(NonEmpty [a] -&gt; [[a]])
-&gt; (NonEmpty (NonEmpty a) -&gt; NonEmpty [a])
-&gt; NonEmpty (NonEmpty a)
-&gt; [[a]]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(NonEmpty a -&gt; [a]) -&gt; NonEmpty (NonEmpty a) -&gt; NonEmpty [a]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; [a]
forall a. NonEmpty a -&gt; [a]
</span><a href="Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span>
</span><span id="line-443"></span><span>
</span><span id="line-444"></span><span class="hs-comment">-- | 'sortBy' for 'NonEmpty', behaves the same as 'Data.List.sortBy'</span><span>
</span><span id="line-445"></span><span id="local-6989586621679567261"><span class="annot"><a href="Data.List.NonEmpty.html#sortBy"><span class="hs-identifier hs-type">sortBy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567261"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567261"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Ordering"><span class="hs-identifier hs-type">Ordering</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567261"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567261"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-446"></span><span id="sortBy"><span class="annot"><span class="annottext">sortBy :: forall a. (a -&gt; a -&gt; Ordering) -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#sortBy"><span class="hs-identifier hs-var hs-var">sortBy</span></a></span></span><span> </span><span id="local-6989586621679566947"><span class="annot"><span class="annottext">a -&gt; a -&gt; Ordering
</span><a href="#local-6989586621679566947"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [a]) -&gt; NonEmpty a -&gt; NonEmpty a
forall (f :: * -&gt; *) a b.
Foldable f =&gt;
([a] -&gt; [b]) -&gt; f a -&gt; NonEmpty b
</span><a href="Data.List.NonEmpty.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; [a]
forall a. (a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; [a]
</span><a href="Data.OldList.html#sortBy"><span class="hs-identifier hs-var">List.sortBy</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Ordering
</span><a href="#local-6989586621679566947"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-447"></span><span>
</span><span id="line-448"></span><span class="hs-comment">-- | 'sortWith' for 'NonEmpty', behaves the same as:</span><span>
</span><span id="line-449"></span><span class="hs-comment">--</span><span>
</span><span id="line-450"></span><span class="hs-comment">-- &gt; sortBy . comparing</span><span>
</span><span id="line-451"></span><span id="local-6989586621679567304"><span id="local-6989586621679567305"><span class="annot"><a href="Data.List.NonEmpty.html#sortWith"><span class="hs-identifier hs-type">sortWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-type">Ord</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567305"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679567304"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679567305"><span class="hs-identifier hs-type">o</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567304"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679567304"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-452"></span><span id="sortWith"><span class="annot"><span class="annottext">sortWith :: forall o a. Ord o =&gt; (a -&gt; o) -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#sortWith"><span class="hs-identifier hs-var hs-var">sortWith</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; Ordering) -&gt; NonEmpty a -&gt; NonEmpty a
forall a. (a -&gt; a -&gt; Ordering) -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="Data.List.NonEmpty.html#sortBy"><span class="hs-identifier hs-var">sortBy</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; a -&gt; Ordering) -&gt; NonEmpty a -&gt; NonEmpty a)
-&gt; ((a -&gt; o) -&gt; a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; o)
-&gt; NonEmpty a
-&gt; NonEmpty a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; o) -&gt; a -&gt; a -&gt; Ordering
forall a b. Ord a =&gt; (b -&gt; a) -&gt; b -&gt; b -&gt; Ordering
</span><a href="Data.Ord.html#comparing"><span class="hs-identifier hs-var">comparing</span></a></span><span>
</span><span id="line-453"></span></pre></body></html>